package org.zwy.gradetrack.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zwy.gradetrack.common.Result;
import org.zwy.gradetrack.entity.Role;
import org.zwy.gradetrack.service.RoleService;

import java.util.List;

/**
 * 角色管理控制器
 */
@RestController
@RequestMapping("/api/roles")
public class RoleController {

    @Autowired
    private RoleService roleService;

    /**
     * 获取所有角色列表
     */
    @GetMapping
    public Result<List<Role>> getAllRoles() {
        return Result.success(roleService.list());
    }
} 